package service.Impl;

import dao.GuaHaoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.GuaHao;
import service.GuaHaoService;
import java.util.List;

@Service
public class GuaHaoServiceImpl implements GuaHaoService {
    @Autowired
    private GuaHaoDao guaHaoDao;

    @Override
    public List<GuaHao> getDoctorsByDepartmentId(Integer departmentId) {
        return guaHaoDao.selectDoctorsByDepartmentId(departmentId);
    }

    @Override
    public GuaHao getDoctorDetailByDocId(String docId) {
        return guaHaoDao.selectDoctorDetailByDocId(docId);
    }

    @Override
    public GuaHao getAvailableSlotsByDocIdAndScheduleId(String docId, String scheduleId) {
        return guaHaoDao.selectAvailableSlotsByDocIdAndScheduleId(docId, scheduleId);
    }

    @Override
    public java.util.List<GuaHao> getDoctorsWithAvailableSlotsByDepartmentAndDate(Integer departmentId, String queryDate) {
        return guaHaoDao.selectDoctorsWithAvailableSlotsByDepartmentAndDate(departmentId, queryDate);
    }
    
    @Override
    public GuaHao getRegistrationConfirmation(String docId, String scheduleId) {
        return guaHaoDao.selectRegistrationConfirmation(docId, scheduleId);
    }

    @Override
    public int registerPatientDoctor(GuaHao guaHao) {
        return guaHaoDao.insertPatientDoctor(guaHao);
    }

    @Override
    public int deletePatientDoctorById(Integer id) {
        return guaHaoDao.deletePatientDoctorById(id);
    }
    @Override
    public List<GuaHao> getAppointmentsByUserId(Integer userId) {
        return guaHaoDao.selectAppointmentsByUserId(userId);
    }
}
